

<div class="heading-buttons">
	<h3 class="glyphicons picture">
		<i></i> Photo Gallery
	</h3>


	<div class="pull-right">

		<?php if($admin['photos']){?>
		<form name="action" method="POST"
			action="<?=base_url(); ?>secure/photos/photos_management">
			<select name="order" onchange="this.form.submit()">
				<option value="">-- Select --</option>
				<option value="inactive">Inactive</option>
				<option value="active">Active</option>


			</select>
		</form>
	</div>
</div>

<div class="separator"></div>
<div class="well">


	<div class="row-fluid gallery">
		<?php if($admin['photos']){?>

		<ul>
			<?php foreach ($admin['photos'] as $photos): ?>

			<li class="span4"><span> <img id="img" class="img-polaroid"
					src="<?= base_url() ?>/assets/images/data/photos/<?= $photos->image; ?>"
					height="125" width="180" alt="<?= $photos->image;?>" />

			</span>
			
				<p>
					<span class="text-error"><b>
					<?php if($this->admin_listing_model->get_business_name($photos->listing_id)){?>
					<?= $this->admin_listing_model->get_business_name($photos->listing_id)->title;?>
					<?php }?>
					
					</b></span>
					<br/>

					<?php if ($photos->status == 1) { ?>
					<a class="btn btn-small btn-info"
						href="<?= base_url(); ?>secure/photos/photos_management/change_photos_status/<?= $photos->status;?>/<?= $photos->id; ?>"
						title="Inactive" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"><i class="icon-thumbs-down icon-white"><i></i></i></a>
					<?php } else { ?>
					<a class="btn btn-small btn-info"
						href="<?= base_url(); ?>secure/photos/photos_management/change_photos_status/<?= $photos->status;?>/<?= $photos->id; ?>"
						title="Active" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"><i class="icon-thumbs-up icon-white"><i></i></i> </a>
					<?php } ?>
<a class="btn btn-small btn-danger"
						href="<?= base_url(); ?>secure/photos/photos_management/delete/<?= $photos->id; ?>/<?= $photos->image; ?>"<?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"
						 ><i class="icon-trash icon-white"><i></i></i></a>

					
				</p> <span class="delete"> </span>
			</li>
			
			
			
			<?php endforeach; 
}?>
			<?php }else { echo "No Data found....";
}?>
		</ul>
	</div>
	<div class="pagination pull-right">
		<ul>
			<li><?php  echo $this->pagination->create_links(); ?>
			</li>
		</ul>
		</div>
</div>

<script>
	function masonryGallery()
	{
		var $container = $('.gallery ul');
		$container
			.imagesLoaded( function(){
				$container.masonry({
					gutterWidth: 14,
			    	itemSelector : 'li',
			    	columnWidth: $('.gallery li:first').width()
			  	});
			});
	}
	$(function()
	{
		masonryGallery();

		$(window).resize(function(e){
			masonryGallery();
		});
	});
	</script>